package com.leadingsoft.pwxk.converter;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.leadingsoft.common.converter.AbstractConverter;
import com.leadingsoft.pwxk.dto.ProductDto;
import com.leadingsoft.pwxk.model.Product;

/**
 * @author: lipan 2018年5月15日
 * @description: ()
 * 
 */

@Component
public class ProductConverter extends AbstractConverter<Product, ProductDto> {

	@Autowired
	private ProductInfoConverter productInfoConverter;


	@Override
	protected ProductDto toDtoActual(Product model) {

		ProductDto dto = new ProductDto();
		dto.setId(model.getId());
		dto.setProductInfolist(productInfoConverter.toDto(model.getProductInfoList()));
		dto.setDataid(model.getDataid());
		return dto;
	}

	@Override
	public void copyProperties(Product model, ProductDto dto) {

	}

}
